//
//  XS_VPFullVC.swift
//  XueDao
//
//  Created by 韩云智 on 2021/1/12.
//

import UIKit

class XS_VPFullVC: XS_BaseVC {
    lazy var shouldClose = false
    override func upConfig() {
        orientations = .landscape
        modalPresentationStyle = .fullScreen
        modalTransitionStyle = .crossDissolve
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        if shouldClose {
            dismiss(animated: true)
        }
    }
}

extension Int64 {
    func toTimeStr() -> String {
        guard self >= 0 else { return "--:--" }
        let time = self / 1000
        let durHour = time / 3600
        let durMin = time / 60 % 60
        let durSec = time % 60
        
        if durHour > 0 {
            return String(format: "%zd:%02zd:%02zd", durHour, durMin, durSec)
        } else {
            return String(format: "%02zd:%02zd", durMin, durSec)
        }
    }
}
